package net.hands.ado.db;

import java.util.Map;

import net.hands.ado.IADOManager;
import net.hands.ado.db.event.IDBListener;
import net.hands.ado.db.jdbc.DatabaseMeta;
import net.hands.ado.db.jdbc.IBatchValueSetter;
import net.hands.ado.db.jdbc.IConnectionCallback;
import net.hands.common.trans.ITransactionManager;

public interface IDBManager extends IADOManager, ITransactionManager {

	/**
	 * 获取元数据
	 * 
	 * @return
	 */
	DatabaseMeta getDatabaseMeta();

	/**
	 * 查询并返回Map对象
	 * 
	 * @param value
	 * @return
	 */
	Map<String, Object> executeQuery(SQLValue value);

	IDBDataQuery executeQuerySet(SQLValue sqlVal);

	/* execute */
	<T> T execute(IConnectionCallback<T> connection);

	/* update */
	int execute(IDBListener l, SQLValue... sqlValues);

	int execute(SQLValue... sqlValues);

	int executeTransaction(IDBListener l, SQLValue... sqlValues);

	int executeTransaction(SQLValue... sqlValues);

	/* batch */
	int[] batchUpdate(String... sql);

	int[] batchUpdate(String sql, int batchCount, IBatchValueSetter setter);

}
